# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-zpng
_pkgname=${pkgname#ruby-}
pkgver=0.4.5
pkgrel=5
pkgdesc='Pure ruby PNG file manipulation and validation.'
arch=('any')
url='https://github.com/zed-0xff/zpng'
license=('MIT')
depends=('ruby' 'ruby-rainbow')
source=("https://rubygems.org/downloads/$_pkgname-$pkgver.gem")
noextract=("$_pkgname-$pkgver.gem")
sha512sums=('421d28c68728a09dc53c43768abc83639338cdd5425d1d4cb7a05eb9059b07192302e11d05b54941a769739e42b148c89a61b6f2fede59e8bb30565530d02a0b')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_pkgname-$pkgver.gem"

  rm "$pkgdir/$_gemdir/cache/$_pkgname-$pkgver.gem"

  find "$pkgdir/$_gemdir/extensions/" -name *.so -delete
}

